<template>
  <div class="my-interface">
    <header>
      <h1>我的应用</h1>
    </header>
    <main>
      <div class="input-container">
        <input type="text" v-model="inputText" placeholder="请输入内容" />
        <button @click="addItem">添加</button>
      </div>
      <ul class="item-list">
        <li v-for="(item, index) in items" :key="index">{{ item }}</li>
      </ul>
    </main>
    <footer>
      <p>版权 © 2023</p>
    </footer>
  </div>
</template>

<script>
export default {
  name: 'MyInterface',
  data() {
    return {
      inputText: '',
      items: [],
    };
  },
  methods: {
    addItem() {
      if (this.inputText.trim()) {
        this.items.push(this.inputText.trim());
        this.inputText = ''; // 清空输入框
      }
    },
  },
};
</script>

<style scoped>
.my-interface {
  text-align: center;
  padding: 20px;
  background-color: #f9f9f9;
}

.input-container {
  margin-bottom: 20px;
}

input {
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

button {
  padding: 10px 15px;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

button:hover {
  background-color: #0056b3;
}

.item-list {
  list-style-type: none;
  padding: 0;
}

.item-list li {
  padding: 10px;
  background-color: #fff;
  margin: 5px 0;
  border: 1px solid #ddd;
  border-radius: 4px;
}
</style>